﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteManage.Master" AutoEventWireup="true" CodeBehind="QuanLiLoaiSach.aspx.cs" Inherits="NXBSaiGon.Admin.QuanLiLoaiSach" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="text-align:center">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="MaLoaiSach" 
        DataSourceID="SqlDataSource1" 
        EmptyDataText="There are no data records to display." ForeColor="#333333" 
        GridLines="None" PageSize="5" Width="295px">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="MaLoaiSach" HeaderText="MaLoaiSach" ReadOnly="True" 
                SortExpression="MaLoaiSach" />
            <asp:BoundField DataField="TenLoaiSach" HeaderText="TenLoaiSach" 
                SortExpression="TenLoaiSach" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>
</div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NXBSaiGonConnectionString1 %>" 
        DeleteCommand="DELETE FROM [LoaiSach] WHERE [MaLoaiSach] = @MaLoaiSach" 
        InsertCommand="INSERT INTO [LoaiSach] ([TenLoaiSach]) VALUES (@TenLoaiSach)" 
        ProviderName="<%$ ConnectionStrings:NXBSaiGonConnectionString1.ProviderName %>" 
        SelectCommand="SELECT [MaLoaiSach], [TenLoaiSach] FROM [LoaiSach]" 
        UpdateCommand="UPDATE [LoaiSach] SET [TenLoaiSach] = @TenLoaiSach WHERE [MaLoaiSach] = @MaLoaiSach">
        <DeleteParameters>
            <asp:Parameter Name="MaLoaiSach" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="TenLoaiSach" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="TenLoaiSach" Type="String" />
            <asp:Parameter Name="MaLoaiSach" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>


    <br />
    <br />
    <h1>Add Loai Sach</h1>
    <asp:DetailsView ID="DetailsView1" runat="server" CellPadding="4" 
        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
        Height="50px" Width="236px">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True" />
        <EditRowStyle BackColor="#7C6F57" />
        <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True" />
        <Fields>
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
    </asp:DetailsView>
    <br />
        
</asp:Content>
